package io.kiki.stack.netty.channelManager;

import io.kiki.stack.netty.lifeCycle.LifeCycleException;
import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;

@Slf4j
@Setter
@Getter
public class ClientChannelManagerImpl extends ChannelManagerImpl {

    public ClientChannelManagerImpl(ChannelSelectStrategy channelSelectStrategy, ChannelFactory channelFactory, ChannelEventHandler channelEventHandler, ChannelEventListener channelEventListener) {
        super(channelSelectStrategy, channelFactory, channelEventHandler, channelEventListener);
    }

    @Override
    public void startup() throws LifeCycleException {
        super.startup();

        this.channelEventHandler.setChannelManager(this);
        this.channelEventHandler.setChannelEventListener(channelEventListener);
        this.channelFactory.init(channelEventHandler);
    }

}
